<h3>ESTACI&Oacute;N 3: Embandado</h3> 
<?php 
    echo $this->Form->create('ServiceOrderRow', array('action' => 'embandado'));
    echo $this->Form->input('id', array('type' => 'hidden'));    
    $tipos = array('A' => 'A', 'B'=>'B', 'C'=>'C', 'D'=>'D', 'F'=>'F', 'G'=>'G'); 
    echo $this->Form->create('ServiceOrderRow'); 
    echo $this->Form->input('service_order_id',  array('type' => 'hidden'));
    //Cambia a estado: cocinado
    echo $this->Form->input('estado_cod',  array('type' => 'hidden', 'value' => '8'));
    
?>
<table  class = "table table-striped">
    <tr>
        <td class="title">Pintado Flux: </td>
        <td class="text"><?php echo $this->Form->radio('pintado_flux',array( 2 =>'   SI ',1 =>'   NO ',), array('empty' => false, 'label' => false, 'legend' => false)); 

            // if ($this->Form->pintado_flux == 2) {
            //     echo $this->Form->radio('pintado_flux',array( 2 =>'   SI ',1 =>'   NO ',), array('empty' => false, 'label' => false, 'legend' => false)); 
            // } else {
            //     //echo $this->Form->radio('pintado_flux',array( 2 =>'   SI ',1 =>'   NO ',), array('empty' => false, 'label' => false, 'legend' => false));
            // }


            //echo $this->Form->set('pintado_flux',  array('type' => 'hidden', 'value' => '0'));
         ?>

        </td>
    </tr>
    <tr>
        <td class="title">Hora pintado flux: </td>
        <td class="text">
            <?php 
                if ($this->data['ServiceOrderRow']['pintado_flux'] == 2) {
                    echo $this->data['ServiceOrderRow']['pintado_flux_hora'];
                } else {
                    $objDateTime = new DateTime('NOW');
                    echo $objDateTime->format('d-m-Y H:i:s'); 
                    $hora = $objDateTime->format('d-m-Y H:i:s'); 
                    echo $this->Form->hidden('pintado_flux_hora',  array('value' => $hora));                          
                }
            ?>
      
        </td>
    </tr>
    <tr>
        <td class="title">Cojin: </td>
        <td class="text">
        <?php echo $this->Form->radio('cojin',array( 2 =>'   SI ',1 =>'   NO ',), array('empty' => false, 'label' => false, 'legend' => false));  ?>
        </td>
    </tr>
    <tr>
        <td class="title">Cojin LOTE: </td>
        <td class="text">
            <?php echo $this->Form->text('cojin_lote', array('label' => false)); ?>
        </td>
    </tr>
    <tr>
       
        <td colspan="2" class="button"><?php echo $this->Form->end('Guardar'); ?></td>
    </tr>
</table>

<h3>Reparaciones </h3>
<?php echo $this->Html->link('Agregar Reparacion', array('controller' => 'ServiceOrderRowRepaires', 'action' => 'add', $service_order['ServiceOrderRow']['id'])); ?><br />
<table width="680px" class="table table-striped">
    <tr>
        <th>Codigo</th>
        <th>Descripcion</th>
        <th>Cantidad</th>
        <th>Comentario</th>
        <th>Fecha</th>
    </tr>
    <?php foreach ($service_order_rows_repaire as $order_repaire): ?>
    <tr>
        <td><?php echo $order_repaire['Repaire']['codigo']; ?></td>
        <td><?php echo $order_repaire['Repaire']['descripcion']; ?></td>
        <td><?php echo $order_repaire['ServiceOrderRowRepaire']['cantidad']; ?></td>
        <td><?php echo $order_repaire['ServiceOrderRowRepaire']['comentario']; ?></td>
        <td><?php echo $order_repaire['ServiceOrderRowRepaire']['fecha']; ?></td>
        <td>
            <?php echo $this->Html->link('Edit', array('controller' => 'ServiceOrderRowRepaires','action' => 'edit', $order_repaire['ServiceOrderRowRepaire']['id'])); ?>
        </td>
         <td>
            <?php echo $this->Html->link('Borrar', array('controller' => 'ServiceOrderRowRepaires','action' => 'delete', $order_repaire['ServiceOrderRowRepaire']['id'])); ?>
        </td>
    </tr>
    <?php endforeach; ?>
    <?php unset($order_repaire); ?>
</table>
